package org.mymail.mail;

import java.io.File;

public class MailConstants {

	public static String mailHome;
	
	static
	{
		File devEnv = new File("./devEnv.txt");
		if(devEnv.exists())
		{
			mailHome = ".";
		}else
		{
			mailHome = System.getenv("TAB_HOME");
		}
	}
	
	public static final String notificationsFile = mailHome
			+ "\\config\\notifications.txt";
	public static final String signatureFile = mailHome
			+ "\\config\\signature.txt";
	public static final String welcomeStringFile = mailHome
			+ "\\config\\welcomeString.txt";
	public static final String recipientsXMLLoc = mailHome
			+ "\\config\\recipients.xml";
	public static final String configXMLLoc = mailHome + "\\config\\config.xml";

	public static final String subscribeFriends = mailHome
			+ "\\config\\subscribeFriends.txt";

	public static final String unSubscribe = mailHome
			+ "\\config\\unsubscribe.txt";

	public static String getUnsubscribeText(int mailFwdType) {
		String strValue = (new StringBuilder(
				"<p>To Unsubscribe from "
						+ MailFwdType.getStringForm(mailFwdType)
						+ ", just mail me <a href=\"mailto:sharath.ravindran2@gmail.com?subject=Unsubscribe Me - "))
				.append(MailFwdType.getStringForm(mailFwdType)).append(
						"\">this</a>").toString();
		return strValue;
	}

	public static String getSubscribeFriendsText(int mailFwdType) {

		String strValue = new StringBuilder()
				.append(
						"<BR><p>Now subscribe your friends to &quot;Calvin and Hobbes&quot;. Just click <A HREF=\""
								+ "mailto:sharath.ravindran2@gmail.com?"
								+ "subject=Subscribe Friends - Calvin and Hobbes&body=Subscribe friends for this. "
								+ "Body Code goes in here\">here</A></p>")
				.toString();

		return strValue;
	}
}